%% Copyright Hilary D. Jones, 1989-1993 /out {print flush} def (Setting up.\n) out /inFile (%stdin) (r) file def /getToken {inFile token pop} bind def /setXform { getToken 72 div /z exch def /tm matrix defaultmatrix def 0 1 3 { dup tm exch get 100 mul z div round 100 div tm 3 1 roll put } for tm setmatrix } bind def /getTypes { /numTypes getToken def } bind def /getRadii { /radii numTypes array def /diam numTypes array def 0 1 numTypes 1 sub { radii exch getToken put } for 0 1 numTypes 1 sub { diam exch dup radii exch get 2 mul 1 add put } for } bind def /getRow { exch dup 3 -1 roll getToken put } bind def /getData { dup diam exch get array exch diam exch get 1 sub 0 exch 1 exch {getRow } for } bind def /getPictures { /idat numTypes array def 0 1 numTypes 1 sub {idat exch dup getData put} for } bind def /row { idat aType get nrow get /nrow nrow 1 add def } bind def /border { newpath radii exch get dup dup 0 360 arc closepath } bind def /pim { gsave translate /aType exch def aType border clip /nrow 0 def diam aType get dup 1 matrix { row } image grestore } bind def /plotOne { getToken dup radii exch get dup getToken exch sub exch getToken exch sub pim } bind def /plotAtoms { 1 1 getToken {pop plotOne} for } bind def /doit { gsave setXform getTypes getRadii (Transferring image data.\n) out getPictures (Rendering images\n) out plotAtoms grestore flush } bind def (Setup complete\n) out doit